package protobuf {
	import com.netease.protobuf.*;
	use namespace com.netease.protobuf.used_by_generated_code;
	import com.netease.protobuf.fieldDescriptors.*;
	import flash.utils.Endian;
	import flash.utils.IDataInput;
	import flash.utils.IDataOutput;
	import flash.utils.IExternalizable;
	import flash.errors.IOError;
	import protobuf.LG_PKG_LOGIN_ACK.ADDR;
	import protobuf.CLIENT_SESSION_CERT;
	import protobuf.LG_PKG_LOGIN_ACK.E_RESULT_TYPE;
	// @@protoc_insertion_point(imports)

	// @@protoc_insertion_point(class_metadata)
	public dynamic final class LG_PKG_LOGIN_ACK extends com.netease.protobuf.Message {
		/**
		 *  @private
		 */
		public static const RESULT:FieldDescriptor$TYPE_ENUM = new FieldDescriptor$TYPE_ENUM("protobuf.LG_PKG_LOGIN_ACK.result", "result", (1 << 3) | com.netease.protobuf.WireType.VARINT, protobuf.LG_PKG_LOGIN_ACK.E_RESULT_TYPE);

		public var result:int;

		/**
		 *  @private
		 */
		public static const CLIENT_CERT:FieldDescriptor$TYPE_MESSAGE = new FieldDescriptor$TYPE_MESSAGE("protobuf.LG_PKG_LOGIN_ACK.client_cert", "clientCert", (2 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED, protobuf.CLIENT_SESSION_CERT);

		private var client_cert$field:protobuf.CLIENT_SESSION_CERT;

		public function clearClientCert():void {
			client_cert$field = null;
		}

		public function get hasClientCert():Boolean {
			return client_cert$field != null;
		}

		public function set clientCert(value:protobuf.CLIENT_SESSION_CERT):void {
			client_cert$field = value;
		}

		public function get clientCert():protobuf.CLIENT_SESSION_CERT {
			return client_cert$field;
		}

		/**
		 *  @private
		 */
		public static const ADDRESSES:RepeatedFieldDescriptor$TYPE_MESSAGE = new RepeatedFieldDescriptor$TYPE_MESSAGE("protobuf.LG_PKG_LOGIN_ACK.addresses", "addresses", (3 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED, protobuf.LG_PKG_LOGIN_ACK.ADDR);

		[ArrayElementType("protobuf.LG_PKG_LOGIN_ACK.ADDR")]
		public var addresses:Array = [];

		/**
		 *  @private
		 */
		override used_by_generated_code final function writeToBuffer(output:com.netease.protobuf.WritingBuffer):void {
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 1);
			com.netease.protobuf.WriteUtils.write$TYPE_ENUM(output, this.result);
			if (hasClientCert) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 2);
				com.netease.protobuf.WriteUtils.write$TYPE_MESSAGE(output, client_cert$field);
			}
			for (var addresses$index:uint = 0; addresses$index < this.addresses.length; ++addresses$index) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 3);
				com.netease.protobuf.WriteUtils.write$TYPE_MESSAGE(output, this.addresses[addresses$index]);
			}
			for (var fieldKey:* in this) {
				super.writeUnknown(output, fieldKey);
			}
		}

		/**
		 *  @private
		 */
		override used_by_generated_code final function readFromSlice(input:flash.utils.IDataInput, bytesAfterSlice:uint):void {
			var result$count:uint = 0;
			var client_cert$count:uint = 0;
			while (input.bytesAvailable > bytesAfterSlice) {
				var tag:uint = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
				switch (tag >> 3) {
				case 1:
					if (result$count != 0) {
						throw new flash.errors.IOError('Bad data format: LG_PKG_LOGIN_ACK.result cannot be set twice.');
					}
					++result$count;
					this.result = com.netease.protobuf.ReadUtils.read$TYPE_ENUM(input);
					break;
				case 2:
					if (client_cert$count != 0) {
						throw new flash.errors.IOError('Bad data format: LG_PKG_LOGIN_ACK.clientCert cannot be set twice.');
					}
					++client_cert$count;
					this.clientCert = new protobuf.CLIENT_SESSION_CERT();
					com.netease.protobuf.ReadUtils.read$TYPE_MESSAGE(input, this.clientCert);
					break;
				case 3:
					this.addresses.push(com.netease.protobuf.ReadUtils.read$TYPE_MESSAGE(input, new protobuf.LG_PKG_LOGIN_ACK.ADDR()));
					break;
				default:
					super.readUnknown(input, tag);
					break;
				}
			}
		}

	}
}
